import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:life_service/color/hex.dart';
import 'package:life_service/model/order.dart';
import 'package:life_service/ui/scroll_refresh_config.dart';
import 'package:life_service/utils/styles.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';

class OrderAllController extends GetxController {
  final RefreshController refreshController = RefreshController();

  RxList<OrderStatusModel> pageList = RxList([]);

  @override
  void onInit() {
    pageList.add(OrderStatusModel(
        name: '待付款，剩余30:00', color: HexColor.colorFf62, tags: ['付款']));
    pageList.add(OrderStatusModel(
        name: '等待酒店确认', color: HexColor.colorFfc7, tags: ['详情']));
    pageList.add(OrderStatusModel(
        name: '已确认，等待入住', color: HexColor.color28d0, tags: ['联系酒店', '导航酒店']));
    super.onInit();
  }

  @override
  void onClose() {
    super.onClose();
    refreshController.dispose();
    Get.delete();
  }

  Future<void> onRefresh() async {
    /// 发起请求
    await Future.delayed(const Duration(milliseconds: 2000));
    refreshController.refreshCompleted(resetFooterState: true);
  }

  Future<void> onLoading() async {
    /// 发起请求
    await Future.delayed(const Duration(milliseconds: 2000));

    /// if failed, use loadFailed(), if no data return, use LoadNodata()
    if (pageList.length > 12) {
      return refreshController.loadNoData();
    }
    pageList.add(OrderStatusModel(
        name: '已消费，等待评价', color: HexColor.color666e, tags: ['去评价', '再次预定']));
    pageList.add(OrderStatusModel(
        name: '支付超时', color: HexColor.color3333, tags: ['删除订单', '再次预定']));
    pageList.add(OrderStatusModel(
        name: '已取消',
        color: HexColor.color3333,
        tags: ['删除订单', '再次预定', '退款进度']));

    /// 添加
    refreshController.loadComplete();
  }
}

class OrderAllView extends GetView<OrderAllController> {
  const OrderAllView({super.key});

  @override
  Widget build(BuildContext context) {
    return Obx(() => scrollRefreshConfig(context));
  }

  Widget scrollRefreshConfig(BuildContext context) {
    return ScrollRefreshConfig(
      refreshController: controller.refreshController,
      onRefresh: controller.onRefresh,
      onLoading: controller.onLoading,
      child: listViewBuilder(context),
    );
  }

  ListView listViewBuilder(BuildContext context) {
    return ListView.builder(
      itemBuilder: (_, index) {
        return GestureDetector(
          onTap: () {},
          child: Container(
            margin: const EdgeInsets.only(top: 15),
            alignment: Alignment.center,
            child: Container(
              width: 334,
              padding: const EdgeInsets.all(15),
              alignment: Alignment.centerLeft,
              decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.circular(10.r),
              ),
              child: Column(
                children: [
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      Image.network(
                        'https://img.axureshop.com/3b/c6/00/3bc600fcb1144d98b45d1938af7321cc/images/%E7%BB%84%E4%BB%B6%E8%A7%84%E8%8C%83/u831.png',
                        width: 18,
                        height: 16,
                        fit: BoxFit.fill,
                      ),
                      Text(
                        controller.pageList[index].name,
                        style: StylesUtils.customTextStyle(
                          fontSize: StylesUtils.fontSize12,
                          color: controller.pageList[index].color,
                        ),
                      ),
                    ],
                  ),
                  Padding(
                    padding: const EdgeInsets.only(top: 15, bottom: 15),
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text(
                          '贯通现代酒店（北京前门店）',
                          style: StylesUtils.customTextStyle(
                            color: HexColor.color3333,
                            fontWeight: FontWeight.w700,
                          ),
                        ),
                        Text(
                          '￥667.00',
                          style: StylesUtils.customTextStyle(
                            color: HexColor.color3333,
                            fontWeight: FontWeight.w700,
                          ),
                        )
                      ],
                    ),
                  ),
                  Align(
                    alignment: Alignment.centerLeft,
                    child: Text(
                      '经济双人房（无窗）',
                      style: StylesUtils.customTextStyle(
                        color: HexColor.color9999,
                        fontSize: StylesUtils.fontSize12,
                      ),
                    ),
                  ),
                  Container(
                    margin: const EdgeInsets.symmetric(vertical: 15),
                    alignment: Alignment.centerLeft,
                    child: Text.rich(
                      TextSpan(
                        children: [
                          TextSpan(
                            text: '12月18日',
                            style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize12,
                              fontWeight: FontWeight.w700,
                              color: HexColor.color3333,
                            ),
                          ),
                          TextSpan(
                            text: '入住    ',
                            style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize12,
                              color: HexColor.color9999,
                            ),
                          ),
                          TextSpan(
                            text: '12月18日',
                            style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize12,
                              fontWeight: FontWeight.w700,
                              color: HexColor.color3333,
                            ),
                          ),
                          TextSpan(
                            text: '离店   ',
                            style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize12,
                              color: HexColor.color9999,
                            ),
                          ),
                          TextSpan(
                            text: '1晚',
                            style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize12,
                              fontWeight: FontWeight.w700,
                              color: HexColor.color3333,
                            ),
                          ),
                        ],
                      ),
                    ),
                  ),
                  Divider(
                    height: 1,
                    thickness: 1,
                    indent: 5,
                    endIndent: 5,
                    color: HexColor(HexColor.colorF2f2),
                  ),
                  Container(
                    padding: const EdgeInsets.only(top: 15),
                    alignment: Alignment.centerRight,
                    child: Wrap(
                      spacing: 20,
                      crossAxisAlignment: WrapCrossAlignment.center,
                      alignment: WrapAlignment.end,
                      children: controller.pageList[index].tags
                          .map(
                            (str) => TextButton(
                              onPressed: () {
                                controller.pageList[index].callbackTap!
                                    .call(controller.pageList[index]);
                              },
                              style: ButtonStyle(
                                fixedSize: const WidgetStatePropertyAll(
                                  Size(80, 30),
                                ),
                                minimumSize: const WidgetStatePropertyAll(
                                  Size(80, 30),
                                ),
                                shape: WidgetStatePropertyAll(
                                  RoundedRectangleBorder(
                                    borderRadius: BorderRadius.circular(5),
                                    side: BorderSide(
                                      color: HexColor(HexColor.colorCccc),
                                    ),
                                  ),
                                ),
                                foregroundColor: const WidgetStatePropertyAll(
                                    Colors.transparent),
                                backgroundColor: const WidgetStatePropertyAll(
                                    Colors.transparent),
                                alignment: Alignment.center,
                              ),
                              child: Text(
                                '去评价',
                                style: StylesUtils.customTextStyle(
                                  fontSize: StylesUtils.fontSize12,
                                  color: HexColor.color3333,
                                ),
                              ),
                            ),
                          )
                          .toList(),
                    ),
                  )
                ],
              ),
            ),
          ),
        );
      },
      itemCount: controller.pageList.length,
    );
  }
}

class OrderPendingPaymentController extends GetxController {
  final RefreshController refreshController = RefreshController();

  RxList<OrderStatusModel> pageList = RxList([]);

  @override
  void onInit() {
    pageList.add(OrderStatusModel(
        name: '待付款，剩余30:00', color: HexColor.colorFf62, tags: ['付款']));
    pageList.add(OrderStatusModel(
        name: '待付款，剩余30:00', color: HexColor.colorFf62, tags: ['付款']));
    pageList.add(OrderStatusModel(
        name: '待付款，剩余30:00', color: HexColor.colorFf62, tags: ['付款']));
    super.onInit();
  }

  @override
  void onClose() {
    super.onClose();
    refreshController.dispose();
    Get.delete();
  }

  Future<void> onRefresh() async {
    /// 发起请求
    await Future.delayed(const Duration(milliseconds: 2000));
    refreshController.refreshCompleted(resetFooterState: true);
  }

  Future<void> onLoading() async {
    /// 发起请求
    await Future.delayed(const Duration(milliseconds: 2000));

    /// if failed, use loadFailed(), if no data return, use LoadNodata()
    if (pageList.length > 12) {
      return refreshController.loadNoData();
    }
    pageList.add(OrderStatusModel(
        name: '待付款，剩余30:00', color: HexColor.colorFf62, tags: ['付款']));
    pageList.add(OrderStatusModel(
        name: '待付款，剩余30:00', color: HexColor.colorFf62, tags: ['付款']));
    pageList.add(OrderStatusModel(
        name: '待付款，剩余30:00', color: HexColor.colorFf62, tags: ['付款']));

    /// 添加
    refreshController.loadComplete();
  }
}

class OrderPendingPaymentView extends GetView<OrderPendingPaymentController> {
  const OrderPendingPaymentView({super.key});

  @override
  Widget build(BuildContext context) {
    return Obx(() => scrollRefreshConfig(context));
  }

  Widget scrollRefreshConfig(BuildContext context) {
    return ScrollRefreshConfig(
      refreshController: controller.refreshController,
      onRefresh: controller.onRefresh,
      onLoading: controller.onLoading,
      child: listViewBuilder(context),
    );
  }

  ListView listViewBuilder(BuildContext context) {
    return ListView.builder(
      itemBuilder: (_, index) {
        return GestureDetector(
          onTap: () {},
          child: Container(
            margin: const EdgeInsets.only(top: 15),
            alignment: Alignment.center,
            child: Container(
              width: 334,
              padding: const EdgeInsets.all(15),
              alignment: Alignment.centerLeft,
              decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.circular(10.r),
              ),
              child: Column(
                children: [
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      Image.network(
                        'https://img.axureshop.com/3b/c6/00/3bc600fcb1144d98b45d1938af7321cc/images/%E7%BB%84%E4%BB%B6%E8%A7%84%E8%8C%83/u831.png',
                        width: 18,
                        height: 16,
                        fit: BoxFit.fill,
                      ),
                      Text(
                        controller.pageList[index].name,
                        style: StylesUtils.customTextStyle(
                          fontSize: StylesUtils.fontSize12,
                          color: controller.pageList[index].color,
                        ),
                      ),
                    ],
                  ),
                  Padding(
                    padding: const EdgeInsets.only(top: 15, bottom: 15),
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text(
                          '贯通现代酒店（北京前门店）',
                          style: StylesUtils.customTextStyle(
                            color: HexColor.color3333,
                            fontWeight: FontWeight.w700,
                          ),
                        ),
                        Text(
                          '￥667.00',
                          style: StylesUtils.customTextStyle(
                            color: HexColor.color3333,
                            fontWeight: FontWeight.w700,
                          ),
                        )
                      ],
                    ),
                  ),
                  Align(
                    alignment: Alignment.centerLeft,
                    child: Text(
                      '经济双人房（无窗）',
                      style: StylesUtils.customTextStyle(
                        color: HexColor.color9999,
                        fontSize: StylesUtils.fontSize12,
                      ),
                    ),
                  ),
                  Container(
                    margin: const EdgeInsets.symmetric(vertical: 15),
                    alignment: Alignment.centerLeft,
                    child: Text.rich(
                      TextSpan(
                        children: [
                          TextSpan(
                            text: '12月18日',
                            style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize12,
                              fontWeight: FontWeight.w700,
                              color: HexColor.color3333,
                            ),
                          ),
                          TextSpan(
                            text: '入住    ',
                            style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize12,
                              color: HexColor.color9999,
                            ),
                          ),
                          TextSpan(
                            text: '12月18日',
                            style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize12,
                              fontWeight: FontWeight.w700,
                              color: HexColor.color3333,
                            ),
                          ),
                          TextSpan(
                            text: '离店   ',
                            style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize12,
                              color: HexColor.color9999,
                            ),
                          ),
                          TextSpan(
                            text: '1晚',
                            style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize12,
                              fontWeight: FontWeight.w700,
                              color: HexColor.color3333,
                            ),
                          ),
                        ],
                      ),
                    ),
                  ),
                  Divider(
                    height: 1,
                    thickness: 1,
                    indent: 5,
                    endIndent: 5,
                    color: HexColor(HexColor.colorF2f2),
                  ),
                  Container(
                    padding: const EdgeInsets.only(top: 15),
                    alignment: Alignment.centerRight,
                    child: Wrap(
                        spacing: 20,
                        crossAxisAlignment: WrapCrossAlignment.center,
                        alignment: WrapAlignment.end,
                        children: controller.pageList[index].tags
                            .map(
                              (str) => TextButton(
                                onPressed: () {},
                                style: ButtonStyle(
                                  fixedSize: const WidgetStatePropertyAll(
                                    Size(80, 30),
                                  ),
                                  minimumSize: const WidgetStatePropertyAll(
                                    Size(80, 30),
                                  ),
                                  shape: WidgetStatePropertyAll(
                                    RoundedRectangleBorder(
                                      borderRadius: BorderRadius.circular(5),
                                      side: BorderSide(
                                        color: HexColor(HexColor.colorCccc),
                                      ),
                                    ),
                                  ),
                                  foregroundColor: const WidgetStatePropertyAll(
                                      Colors.transparent),
                                  backgroundColor: const WidgetStatePropertyAll(
                                      Colors.transparent),
                                  alignment: Alignment.center,
                                ),
                                child: Text(
                                  str,
                                  style: StylesUtils.customTextStyle(
                                    fontSize: StylesUtils.fontSize12,
                                    color: HexColor.color3333,
                                  ),
                                ),
                              ),
                            )
                            .toList()),
                  )
                ],
              ),
            ),
          ),
        );
      },
      itemCount: controller.pageList.length,
    );
  }
}

class OrderCheckInController extends GetxController {
  final RefreshController refreshController = RefreshController();

  RxList<OrderStatusModel> pageList = RxList([]);

  @override
  void onInit() {
    pageList.add(OrderStatusModel(
        name: '等待酒店确认', color: HexColor.colorFfc7, tags: ['详情']));
    pageList.add(OrderStatusModel(
        name: '已确认，等待入住', color: HexColor.color28d0, tags: ['联系酒店', '酒店导航']));
    pageList.add(OrderStatusModel(
        name: '已确认，等待入住', color: HexColor.color28d0, tags: ['联系酒店', '酒店导航']));
    super.onInit();
  }

  @override
  void onClose() {
    super.onClose();
    refreshController.dispose();
    Get.delete();
  }

  Future<void> onRefresh() async {
    /// 发起请求
    await Future.delayed(const Duration(milliseconds: 2000));
    refreshController.refreshCompleted(resetFooterState: true);
  }

  Future<void> onLoading() async {
    /// 发起请求
    await Future.delayed(const Duration(milliseconds: 2000));

    /// if failed, use loadFailed(), if no data return, use LoadNodata()
    if (pageList.length > 9) {
      return refreshController.loadNoData();
    }
    pageList.add(OrderStatusModel(
        name: '等待酒店确认', color: HexColor.colorFfc7, tags: ['详情']));
    pageList.add(OrderStatusModel(
        name: '已确认，等待入住', color: HexColor.color28d0, tags: ['联系酒店', '酒店导航']));
    pageList.add(OrderStatusModel(
        name: '已确认，等待入住', color: HexColor.color28d0, tags: ['联系酒店', '酒店导航']));

    /// 添加
    refreshController.loadComplete();
  }
}

class OrderCheckInView extends GetView<OrderCheckInController> {
  const OrderCheckInView({super.key});

  @override
  Widget build(BuildContext context) {
    return Obx(() => scrollRefreshConfig(context));
  }

  Widget scrollRefreshConfig(BuildContext context) {
    return ScrollRefreshConfig(
      refreshController: controller.refreshController,
      onRefresh: controller.onRefresh,
      onLoading: controller.onLoading,
      child: listViewBuilder(context),
    );
  }

  ListView listViewBuilder(BuildContext context) {
    return ListView.builder(
      itemBuilder: (_, index) {
        return GestureDetector(
          onTap: () {},
          child: Container(
            margin: const EdgeInsets.only(top: 15),
            alignment: Alignment.center,
            child: Container(
              width: 334,
              padding: const EdgeInsets.all(15),
              alignment: Alignment.centerLeft,
              decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.circular(10.r),
              ),
              child: Column(
                children: [
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      Image.network(
                        'https://img.axureshop.com/3b/c6/00/3bc600fcb1144d98b45d1938af7321cc/images/%E7%BB%84%E4%BB%B6%E8%A7%84%E8%8C%83/u831.png',
                        width: 18,
                        height: 16,
                        fit: BoxFit.fill,
                      ),
                      Text(
                        controller.pageList[index].name,
                        style: StylesUtils.customTextStyle(
                          fontSize: StylesUtils.fontSize12,
                          color: controller.pageList[index].color,
                        ),
                      ),
                    ],
                  ),
                  Padding(
                    padding: const EdgeInsets.only(top: 15, bottom: 15),
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text(
                          '贯通现代酒店（北京前门店）',
                          style: StylesUtils.customTextStyle(
                            color: HexColor.color3333,
                            fontWeight: FontWeight.w700,
                          ),
                        ),
                        Text(
                          '￥667.00',
                          style: StylesUtils.customTextStyle(
                            color: HexColor.color3333,
                            fontWeight: FontWeight.w700,
                          ),
                        )
                      ],
                    ),
                  ),
                  Align(
                    alignment: Alignment.centerLeft,
                    child: Text(
                      '经济双人房（无窗）',
                      style: StylesUtils.customTextStyle(
                        color: HexColor.color9999,
                        fontSize: StylesUtils.fontSize12,
                      ),
                    ),
                  ),
                  Container(
                    margin: const EdgeInsets.symmetric(vertical: 15),
                    alignment: Alignment.centerLeft,
                    child: Text.rich(
                      TextSpan(
                        children: [
                          TextSpan(
                            text: '12月18日',
                            style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize12,
                              fontWeight: FontWeight.w700,
                              color: HexColor.color3333,
                            ),
                          ),
                          TextSpan(
                            text: '入住    ',
                            style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize12,
                              color: HexColor.color9999,
                            ),
                          ),
                          TextSpan(
                            text: '12月18日',
                            style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize12,
                              fontWeight: FontWeight.w700,
                              color: HexColor.color3333,
                            ),
                          ),
                          TextSpan(
                            text: '离店   ',
                            style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize12,
                              color: HexColor.color9999,
                            ),
                          ),
                          TextSpan(
                            text: '1晚',
                            style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize12,
                              fontWeight: FontWeight.w700,
                              color: HexColor.color3333,
                            ),
                          ),
                        ],
                      ),
                    ),
                  ),
                  Divider(
                    height: 1,
                    thickness: 1,
                    indent: 5,
                    endIndent: 5,
                    color: HexColor(HexColor.colorF2f2),
                  ),
                  Container(
                    padding: const EdgeInsets.only(top: 15),
                    alignment: Alignment.centerRight,
                    child: Wrap(
                        spacing: 20,
                        crossAxisAlignment: WrapCrossAlignment.center,
                        alignment: WrapAlignment.end,
                        children: controller.pageList[index].tags
                            .map(
                              (str) => TextButton(
                                onPressed: () {},
                                style: ButtonStyle(
                                  fixedSize: const WidgetStatePropertyAll(
                                    Size(80, 30),
                                  ),
                                  minimumSize: const WidgetStatePropertyAll(
                                    Size(80, 30),
                                  ),
                                  shape: WidgetStatePropertyAll(
                                    RoundedRectangleBorder(
                                      borderRadius: BorderRadius.circular(5),
                                      side: BorderSide(
                                        color: HexColor(HexColor.colorCccc),
                                      ),
                                    ),
                                  ),
                                  foregroundColor: const WidgetStatePropertyAll(
                                      Colors.transparent),
                                  backgroundColor: const WidgetStatePropertyAll(
                                      Colors.transparent),
                                  alignment: Alignment.center,
                                ),
                                child: Text(
                                  str,
                                  style: StylesUtils.customTextStyle(
                                    fontSize: StylesUtils.fontSize12,
                                    color: HexColor.color3333,
                                  ),
                                ),
                              ),
                            )
                            .toList()),
                  )
                ],
              ),
            ),
          ),
        );
      },
      itemCount: controller.pageList.length,
    );
  }
}

class OrderConsumedController extends GetxController {
  final RefreshController refreshController = RefreshController();

  RxList<OrderStatusModel> pageList = RxList([]);

  @override
  void onInit() {
    pageList.add(OrderStatusModel(
        name: '已消费，等待评价', color: HexColor.color666e, tags: ['去评价', '再次预定']));
    pageList.add(OrderStatusModel(
        name: '已消费，等待评价', color: HexColor.color666e, tags: ['去评价', '再次预定']));
    pageList.add(OrderStatusModel(
        name: '已消费，等待评价', color: HexColor.color666e, tags: ['去评价', '再次预定']));
    super.onInit();
  }

  @override
  void onClose() {
    super.onClose();
    refreshController.dispose();
    Get.delete();
  }

  Future<void> onRefresh() async {
    /// 发起请求
    await Future.delayed(const Duration(milliseconds: 2000));
    refreshController.refreshCompleted(resetFooterState: true);
  }

  Future<void> onLoading() async {
    /// 发起请求
    await Future.delayed(const Duration(milliseconds: 2000));

    /// if failed, use loadFailed(), if no data return, use LoadNodata()
    if (pageList.length > 9) {
      return refreshController.loadNoData();
    }
    pageList.add(OrderStatusModel(
        name: '已消费，等待评价', color: HexColor.color666e, tags: ['去评价', '再次预定']));
    pageList.add(OrderStatusModel(
        name: '已消费，等待评价', color: HexColor.color666e, tags: ['去评价', '再次预定']));
    pageList.add(OrderStatusModel(
        name: '已消费，等待评价', color: HexColor.color666e, tags: ['去评价', '再次预定']));

    /// 添加
    refreshController.loadComplete();
  }
}

class OrderConsumedView extends GetView<OrderConsumedController> {
  const OrderConsumedView({super.key});

  @override
  Widget build(BuildContext context) {
    return Obx(() => scrollRefreshConfig(context));
  }

  Widget scrollRefreshConfig(BuildContext context) {
    return ScrollRefreshConfig(
      refreshController: controller.refreshController,
      onRefresh: controller.onRefresh,
      onLoading: controller.onLoading,
      child: listViewBuilder(context),
    );
  }

  ListView listViewBuilder(BuildContext context) {
    return ListView.builder(
      itemBuilder: (_, index) {
        return GestureDetector(
          onTap: () {},
          child: Container(
            margin: const EdgeInsets.only(top: 15),
            alignment: Alignment.center,
            child: Container(
              width: 334,
              padding: const EdgeInsets.all(15),
              alignment: Alignment.centerLeft,
              decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.circular(10.r),
              ),
              child: Column(
                children: [
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      Image.network(
                        'https://img.axureshop.com/3b/c6/00/3bc600fcb1144d98b45d1938af7321cc/images/%E7%BB%84%E4%BB%B6%E8%A7%84%E8%8C%83/u831.png',
                        width: 18,
                        height: 16,
                        fit: BoxFit.fill,
                      ),
                      Text(
                        controller.pageList[index].name,
                        style: StylesUtils.customTextStyle(
                          fontSize: StylesUtils.fontSize12,
                          color: controller.pageList[index].color,
                        ),
                      ),
                    ],
                  ),
                  Padding(
                    padding: const EdgeInsets.only(top: 15, bottom: 15),
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text(
                          '贯通现代酒店（北京前门店）',
                          style: StylesUtils.customTextStyle(
                            color: HexColor.color3333,
                            fontWeight: FontWeight.w700,
                          ),
                        ),
                        Text(
                          '￥667.00',
                          style: StylesUtils.customTextStyle(
                            color: HexColor.color3333,
                            fontWeight: FontWeight.w700,
                          ),
                        )
                      ],
                    ),
                  ),
                  Align(
                    alignment: Alignment.centerLeft,
                    child: Text(
                      '经济双人房（无窗）',
                      style: StylesUtils.customTextStyle(
                        color: HexColor.color9999,
                        fontSize: StylesUtils.fontSize12,
                      ),
                    ),
                  ),
                  Container(
                    margin: const EdgeInsets.symmetric(vertical: 15),
                    alignment: Alignment.centerLeft,
                    child: Text.rich(
                      TextSpan(
                        children: [
                          TextSpan(
                            text: '12月18日',
                            style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize12,
                              fontWeight: FontWeight.w700,
                              color: HexColor.color3333,
                            ),
                          ),
                          TextSpan(
                            text: '入住    ',
                            style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize12,
                              color: HexColor.color9999,
                            ),
                          ),
                          TextSpan(
                            text: '12月18日',
                            style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize12,
                              fontWeight: FontWeight.w700,
                              color: HexColor.color3333,
                            ),
                          ),
                          TextSpan(
                            text: '离店   ',
                            style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize12,
                              color: HexColor.color9999,
                            ),
                          ),
                          TextSpan(
                            text: '1晚',
                            style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize12,
                              fontWeight: FontWeight.w700,
                              color: HexColor.color3333,
                            ),
                          ),
                        ],
                      ),
                    ),
                  ),
                  Divider(
                    height: 1,
                    thickness: 1,
                    indent: 5,
                    endIndent: 5,
                    color: HexColor(HexColor.colorF2f2),
                  ),
                  Container(
                    padding: const EdgeInsets.only(top: 15),
                    alignment: Alignment.centerRight,
                    child: Wrap(
                        spacing: 20,
                        crossAxisAlignment: WrapCrossAlignment.center,
                        alignment: WrapAlignment.end,
                        children: controller.pageList[index].tags
                            .map(
                              (str) => TextButton(
                                onPressed: () {},
                                style: ButtonStyle(
                                  fixedSize: const WidgetStatePropertyAll(
                                    Size(80, 30),
                                  ),
                                  minimumSize: const WidgetStatePropertyAll(
                                    Size(80, 30),
                                  ),
                                  shape: WidgetStatePropertyAll(
                                    RoundedRectangleBorder(
                                      borderRadius: BorderRadius.circular(5),
                                      side: BorderSide(
                                        color: HexColor(HexColor.colorCccc),
                                      ),
                                    ),
                                  ),
                                  foregroundColor: const WidgetStatePropertyAll(
                                      Colors.transparent),
                                  backgroundColor: const WidgetStatePropertyAll(
                                      Colors.transparent),
                                  alignment: Alignment.center,
                                ),
                                child: Text(
                                  str,
                                  style: StylesUtils.customTextStyle(
                                    fontSize: StylesUtils.fontSize12,
                                    color: HexColor.color3333,
                                  ),
                                ),
                              ),
                            )
                            .toList()),
                  )
                ],
              ),
            ),
          ),
        );
      },
      itemCount: controller.pageList.length,
    );
  }
}
